package com.lp.learn.learnspringboot.controller;

import com.lp.learn.learnspringboot.entity.User;
import com.lp.learn.learnspringboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/getUser")
    public User getUser(){
        return userService.findUserById(1);
    }
    @RequestMapping("/getUsers")
    public List<User> getUsers(){
        return userService.getUsers();
    }
}
